<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>[|.siteName|]</title>
    [|if .zTree|]
    <link rel="stylesheet" href="/static/zTree3/css/demo.css?t=5" type="text/css">
    <link rel="stylesheet" href="/static/zTree3/css/zTreeStyle/zTreeStyle.css" type="text/css">
    [|end|]
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/main.css">
    <script src="/static/layui/layui.js?s=36"></script>
    <script src="/static/js/main.js?s=2124"></script>
</head>

<body>
<div>
    <form>
        <div class="layui-input-inline">
            
            <div class="layui-inline">
                <label class="layui-form-label">玩家推广号:</label>
                <div class="layui-input-inline" style="width:150px">
                    <input type="number" name="UserGameID" id="UserGameID" lay-verify="required|number" autocomplete="off" class="layui-input" value="">
                </div>
            </div>
          
            <div class="layui-inline">
                <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="starquery">开始查询</button>
            </div>

        </div>
    </form>
    <table  class="layui-table" id="userinfotable" lay-size="sm" lay-filter="layfilteruserinfotable"> </table> 
</div>

<script>
    var $;

    layui.config({
            base : "js/"
    }).use(['form','element','layer','jquery','table'], function(){
        var table = layui.table;
        var element = layui.element;
        var form = layui.form;
        $ = layui.jquery;
    //监听表格复选框选择
   // table.on('checkbox(demo)', function(obj){
    //   console.log(obj);
   // });


    ShowTablesDatas(table);
    form.on('submit(starquery)', function(data) { 
        ShowTablesDatas(table)   
        return false;
    });

    //监听单元格事件
   table.on('tool(layfilteruserinfotable)', function(obj){
        var data = obj.data;
        if(obj.event === 'UserInfo'){
            window.location.href="/usersfinduser/userinfopage.html?UserID=" + data.columnB +"&UserNickName=" + data.columnC;
            return false;
        }
     });
   
    return false;
}); 


function ShowTablesDatas(thisTabble){
 
    var dUserGameID =  document.getElementById("UserGameID");
  
    thisTabble.render({
        elem:'#userinfotable'
        ,url:'/userrecord/userrecordphonecodetable'
        ,where: {
                UserGameID: dUserGameID.value
        }
        ,cols: [[ //标题栏
            {field:'columnA',title:'验证码',width:200 ,style:'color: #FF0000;'}
            ,{field:'columnB',title:'推广号',width:200,event: 'UserInfo', style:'cursor: pointer;color: #104E8B;'}
            ,{field:'columnC',title:'昵称',width:200,event: 'UserInfo', style:'cursor: pointer;color: #104E8B;'}
                ]] 
        ,skin: 'row' //表格风格
        ,even: true
        ,page: false //是否显示分页
        ,limits: [50,100,200]
        ,limit: 100//每页默认显示的数量
        ,width: 'full-10'
        ,rules: 'all'
        ,height: 'full-170'
    });
}



</script>
</body>

</html>